#include "stdafx.h"
#include "VSCtxMenuFixCommon.h"

LPWSTR GetCurrentProcessFileName()
{
    CMyBuffer<WCHAR> result(MAX_PATH + 1);

    if (result.IsNull())
    {
        return NULL;
    }

    HANDLE hProcess = GetCurrentProcess();

    if (!GetModuleFileNameEx(hProcess, NULL, result.GetBuffer(), MAX_PATH + 1))
    {
        return NULL;
    }

    return result.Detach();
}
